var url = require('url')
console.log(url.parse('http://www.baidu.com:8080/a/b/c?d=1&e=2',true));
==>
Url {
    protocol: 'http:',
    slashes: true,
    auth: null,
    host: 'www.baidu.com:8080',
    port: '8080',
    hostname: 'www.baidu.com',
    hash: null,
    search: '?d=1&e=2',
    query: [Object: null prototype] { d: '1', e: '2' },
    pathname: '/a/b/c',
    path: '/a/b/c?d=1&e=2',
    href: 'http://www.baidu.com:8080/a/b/c?d=1&e=2'
  }